#ifndef QTREEINDEXDATA_H
#define QTREEINDEXDATA_H

#include "sharedlibglobal.h"

#include <QMap>
#include <QStringList>
#include <QVariant>


class XMLObject;
class SHAREDLIB_EXPORT QTreeIndexData
{
public:
    QTreeIndexData();
    QTreeIndexData(const QTreeIndexData& data);
    void    from_xml(XMLObject* xml);
    void    to_xml(XMLObject* xml);
    bool    operator ==(const QTreeIndexData &data);
    bool    operator !=(const QTreeIndexData &data);
public:
    QMap<QString,QString>       m_attributes;
};

class SHAREDLIB_EXPORT QTreeRowData
{
public:
    QTreeRowData();
    QTreeRowData(const QTreeRowData& data);
    ~QTreeRowData();

    void    from_xml(XMLObject* xml);
    void    to_xml(XMLObject* xml);
    bool    operator ==(const QTreeRowData &data);
    bool    operator !=(const QTreeRowData &data);
public:
    QList<QTreeIndexData*>    m_indexs;
    QList<QTreeRowData*>        m_children;
};

class SHAREDLIB_EXPORT QTreeData
{
public:
    QTreeData();
    QTreeData(const QTreeData& data);
    ~QTreeData();

    void    from_xml(XMLObject* xml);
    void    to_xml(XMLObject* xml);

    bool    operator ==(const QTreeData &data);
    bool    operator !=(const QTreeData &data);
public:
    QStringList             m_labels;
    QList<QTreeRowData*>    m_rows;
};

Q_DECLARE_METATYPE(QTreeData)

#endif // QTREEINDEXDATA_H
